package transfer;

import java.util.ArrayList;

/**
 * This class represents row from table User. This class is used for transfer
 * operations.
 *
 * @author Vadym Gula
 * @author Oleh Tarapata
 */
public class User {

    private Integer idUser;
    private Address address;
    private String login;
    private String password;
    private String firstName;
    private String lastName;
    private String email;
    private ArrayList roles = new ArrayList();

    public User() {
    }

    public User(Integer idUser, Address address, String login, String password, String firstName, String lastName, String email) {
        this.idUser = idUser;
        this.address = address;
        this.login = login;
        this.password = password;
        this.firstName = firstName;
        this.lastName = lastName;
        this.email = email;
    }

    public Integer getIdUser() {
        return idUser;
    }

    public void setIdUser(Integer idUser) {
        this.idUser = idUser;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public ArrayList getRoles() {
        return roles;
    }

    public void setRoles(ArrayList roles) {
        this.roles = roles;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    public int hashCode() {
        return idUser.intValue();
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final User other = (User) obj;
        return idUser.equals(other.idUser);
    }
}
